package com.ybkj.daijia.server.zhuan;

import com.ybkj.daijia.server.model.Area;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;

//专车订单
public class Order extends com.ybkj.daijia.server.abstractModels.Order implements Serializable {

    /**
     * 新单
     */
    public static final int ORDER_STATUS_NEW = 0;
    /**
     * 已派单
     */
    public static final int ORDER_STATUS_PAIDAN = 1;
    /**
     * 已接单
     */
    public static final int ORDER_STATUS_JIEDAN = 2;
    /**
     * 到达预约地
     */
    public static final int ORDER_STATUS_ARRIVE = 3;
    /**
     * 执行中
     */
    public static final int ORDER_STATUS_ZHIXING = 4;
    /**
     * 已到达
     */
    public static final int ORDER_STATUS_ARRIVE_DISTANCE = 5;
    /**
     * 已完成
     */
    public static final int ORDER_STATUS_OK = 6;
    /**
     * 已销单
     */
    public static final int ORDER_STATUS_XIAODAN = 7;
    public static final String ORDER_TYPE_PHONE = "电话预约";
    public static final String ORDER_TYPE_APP = "APP预约";
    public static final String ORDER_TYPE_WEIXIN = "微信预约";
    public static final String ORDER_TYPE_WEB = "网站预约";
    public static final String ORDER_TYPE_BUDAN = "司机补单";
    private static final long serialVersionUID = 1L;
    private Long passengerId;//客户Id

    private String passengerName;//客户名称

    private String passengerPhone;//客户电话

    private String showPhone;//下单电话

    private Long carId;//车辆Id

    private Long carTypeId;//车辆类型

    private String carTypeName;//车辆类型名称

    private String carNumber;//车牌号

    private String carName;//车辆名称

    private Long channelId;//渠道Id

    private Integer status;//状态:0:新单  1:已派单  2:已接单  3:到达预约地 4:执行中 5:已完成  6:已销单

    private String employName;//服务人员名称

    private String employPhone;//服务人员电话

    private String companyName;//所属公司名称

    private String appkey;//区分系统

    private Date created;//下单时间

    private Date updated;

    private Boolean isClosed;//后台催单提示框是否关闭

    private Boolean review;//是否评价

    private Long version;//操作版本

    private String cancelCause;//销单原因

    private String payType;//支付类型

    private Date lasturge;//上次催促时间

    private Integer startWait;//开始等待时间

    private String startAddress;//预约地

    private Double startLat;//预约地纬度

    private Double startLng;//预约地经度

    private Long midwayWait;//等待时间

    private String endAddress;//目的地

    private Double endLat;//目的地纬度

    private Double endLng;//目的地经度

    private Long employCompanyId;//服务人员所属公司Id

    private Double employProfit;//服务人员收入

    private Double companyProfit;//公司收入

    private Double startPrice;//起步价

    private Double mileage;//服务里程

    private Long runTime;//服务时间单位秒

    private Double mileagePrice;//里程费用

    private Double runTimePrice;//时间费用

    private Double waitPrice;//等候时间 单位秒

    private Double budgetPay;//预估价格

    private Double realPay;//实收金额

    private Date serverTime;//预约时间

    private String orderMemo;//临时字段（订单备注）

    private Boolean zhuanchePrePay;//临时字段(是否预付费)

    private Long areaId;//地区收费Id

    private Area area;//地区收费

    private List<OrderMemo> orderMemos;//订单备注

    private OrderReview orderReview;//评价

    private List<OrderStatus> statusList;//订单的所有状态记录

    private String startAddressDetail;//预约地详细地址

    private String endAddressDetail;//目的地详细地址

    private Double preStartPrice;

    private Double premileagePrice;

    private Double prerunTimePrice;

    private Integer pretravelTime;

    private Double premileage;

    private BigDecimal couponMoney;//优惠券金额

    private BigDecimal cashMoney;//现金金额

    private BigDecimal signMoney;//签单金额

    private BigDecimal balanceMoney;//余额金额

    private BigDecimal alipayMoney;//支付宝金额

    private BigDecimal weixinMoney;//微信金额

    private BigDecimal unionpayMoney; // 银联支付金额

    private BigDecimal guoluMoney;//过路费

    private BigDecimal yuanchengMoney;//远程费

    private BigDecimal otherMoney;//其他费

    private BigDecimal baoxiaoMoney;//报销费用

    private boolean baoxiao;//是否已报销

    private PayTypeDetails prePayTypeDetail; // 预支付方式

    private PayTypeDetails afterPayTypeDetail; // 后支付方式（可能无）

    private Long couponId;//优惠券id

    private Double discount;//折扣

    private boolean treatment;//后支付是否成功付款

    private Date treatmentDate;     //处理确认时间

    private Date finishTime;//结算时间 临时字段

    private String employMemo;

    private Long serviceTypeId;//

    private ServiceType serviceType;

    private String memo;//用车需求

    private String flightNo;//航班号

    private String trainNo;//车次号

    private Long groupId;//分组id

    private String operating;//完工操作人

    private String baoxiaoMemo;//报销说明

    private String employPhoto;//司机头像

    private Double justKilometres;//司机调价（公里数）

    private BigDecimal justMoney;//司机调价（金额）

    private Double ksMileage;//空驶里程

    private Double ddMileage;//调度里程

    private String realStartAddress;//真实上车地

    private Double realStartLat;//真实上车地纬度

    private Double realStartLng;//真实上车地经度

    private Integer bookStatus;//0-非预约订单，1-预约订单
    /**
     * 仅用于返回的新加字段，与数据库不关联
     */
    private String ifTaxi; // 是否是出租车
    private String createOrderName;
    private BigDecimal makePrice;//订单定价
    private Integer isMakePrice;//是否为订单定价 0.否   1.是

    public Integer getBookStatus() {
        return bookStatus;
    }

    public void setBookStatus(Integer bookStatus) {
        this.bookStatus = bookStatus;
    }

    public BigDecimal getMakePrice() {
        if (makePrice == null) {
            return new BigDecimal(0);
        }
        return makePrice;
    }

    public void setMakePrice(BigDecimal makePrice) {
        this.makePrice = makePrice;
    }

    public Integer getIsMakePrice() {
        if (isMakePrice == null) {
            return 0;
        }
        return isMakePrice;
    }

    public void setIsMakePrice(Integer isMakePrice) {
        this.isMakePrice = isMakePrice;
    }

    public Double getJustKilometres() {
        if (null == justKilometres) {
            return 0d;
        }
        return justKilometres;
    }

    public void setJustKilometres(Double justKilometres) {
        this.justKilometres = justKilometres;
    }

    public BigDecimal getJustMoney() {
        if (null == justMoney) {
            return BigDecimal.ZERO;
        }
        return justMoney;
    }

    public void setJustMoney(BigDecimal justMoney) {
        this.justMoney = justMoney;
    }

    public String getEmployPhoto() {
        return employPhoto;
    }

    public void setEmployPhoto(String employPhoto) {
        this.employPhoto = employPhoto;
    }

    public String getOperating() {
        return operating;
    }

    public void setOperating(String operating) {
        this.operating = operating;
    }

    public String getBaoxiaoMemo() {
        if (null == baoxiaoMemo) {
            return "";
        }
        return baoxiaoMemo;
    }

    public void setBaoxiaoMemo(String baoxiaoMemo) {
        this.baoxiaoMemo = baoxiaoMemo;
    }


    public String getCreateOrderName() {
        return createOrderName;
    }

    public void setCreateOrderName(String createOrderName) {
        this.createOrderName = createOrderName;
    }

    public String getFlightNo() {
        return flightNo;
    }

    public void setFlightNo(String flightNo) {
        this.flightNo = flightNo;
    }

    public String getTrainNo() {
        return trainNo;
    }

    public void setTrainNo(String trainNo) {
        this.trainNo = trainNo;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public Long getServiceTypeId() {
        return serviceTypeId;
    }

    public void setServiceTypeId(Long serviceTypeId) {
        this.serviceTypeId = serviceTypeId;
    }

    public ServiceType getServiceType() {
        return serviceType;
    }

    public void setServiceType(ServiceType serviceType) {
        this.serviceType = serviceType;
    }

    public BigDecimal getBaoxiaoMoney() {
        if (null == baoxiaoMoney) {
            return BigDecimal.ZERO;
        }
        return baoxiaoMoney;
    }

    public void setBaoxiaoMoney(BigDecimal baoxiaoMoney) {
        this.baoxiaoMoney = baoxiaoMoney;
    }

    public boolean isBaoxiao() {
        return baoxiao;
    }

    public void setBaoxiao(boolean baoxiao) {
        this.baoxiao = baoxiao;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getEmployMemo() {
        return employMemo;
    }

    public void setEmployMemo(String employMemo) {
        this.employMemo = employMemo;
    }

    public String getShowPhone() {
        return showPhone;
    }

    public void setShowPhone(String showPhone) {
        this.showPhone = showPhone;
    }

    public BigDecimal getCouponMoney() {
        if (null == couponMoney) {
            return BigDecimal.ZERO;
        }
        return couponMoney;
    }

    public void setCouponMoney(BigDecimal couponMoney) {
        this.couponMoney = couponMoney;
    }

    public BigDecimal getCashMoney() {
        if (null == cashMoney) {
            return BigDecimal.ZERO;
        }
        return cashMoney;
    }

    public void setCashMoney(BigDecimal cashMoney) {
        this.cashMoney = cashMoney;
    }

    public BigDecimal getSignMoney() {
        if (null == signMoney) {
            return BigDecimal.ZERO;
        }
        return signMoney;
    }

    public void setSignMoney(BigDecimal signMoney) {
        this.signMoney = signMoney;
    }

    public BigDecimal getBalanceMoney() {
        if (null == balanceMoney) {
            return BigDecimal.ZERO;
        }
        return balanceMoney;
    }

    public void setBalanceMoney(BigDecimal balanceMoney) {
        this.balanceMoney = balanceMoney;
    }

    public BigDecimal getAlipayMoney() {
        if (null == alipayMoney) {
            return BigDecimal.ZERO;
        }
        return alipayMoney;
    }

    public void setAlipayMoney(BigDecimal alipayMoney) {
        this.alipayMoney = alipayMoney;
    }

    public BigDecimal getWeixinMoney() {
        if (null == weixinMoney) {
            return BigDecimal.ZERO;
        }
        return weixinMoney;
    }

    public void setWeixinMoney(BigDecimal weixinMoney) {
        this.weixinMoney = weixinMoney;
    }

    public BigDecimal getUnionpayMoney() {
        if (null == unionpayMoney) {
            return BigDecimal.ZERO;
        }
        return unionpayMoney;
    }

    public void setUnionpayMoney(BigDecimal unionpayMoney) {
        this.unionpayMoney = unionpayMoney;
    }

    public BigDecimal getGuoluMoney() {
        if (null == guoluMoney) {
            return BigDecimal.ZERO;
        }
        return guoluMoney;
    }

    public void setGuoluMoney(BigDecimal guoluMoney) {
        this.guoluMoney = guoluMoney;
    }

    public BigDecimal getYuanchengMoney() {
        if (null == yuanchengMoney) {
            return BigDecimal.ZERO;
        }
        return yuanchengMoney;
    }

    public void setYuanchengMoney(BigDecimal yuanchengMoney) {
        this.yuanchengMoney = yuanchengMoney;
    }

    public BigDecimal getOtherMoney() {
        if (null == otherMoney) {
            return BigDecimal.ZERO;
        }
        return otherMoney;
    }

    public void setOtherMoney(BigDecimal otherMoney) {
        this.otherMoney = otherMoney;
    }

    public PayTypeDetails getPrePayTypeDetail() {
        return prePayTypeDetail;
    }

    public void setPrePayTypeDetail(PayTypeDetails prePayTypeDetail) {
        this.prePayTypeDetail = prePayTypeDetail;
    }

    public PayTypeDetails getAfterPayTypeDetail() {
        return afterPayTypeDetail;
    }

    public void setAfterPayTypeDetail(PayTypeDetails afterPayTypeDetail) {
        this.afterPayTypeDetail = afterPayTypeDetail;
    }

    public boolean isTreatment() {
        return treatment;
    }

    public void setTreatment(boolean treatment) {
        this.treatment = treatment;
    }

    public Date getTreatmentDate() {
        return treatmentDate;
    }

    public void setTreatmentDate(Date treatmentDate) {
        this.treatmentDate = treatmentDate;
    }

    public Double getPreStartPrice() {
        return preStartPrice;
    }

    public void setPreStartPrice(Double preStartPrice) {
        this.preStartPrice = preStartPrice;
    }

    public Double getPremileagePrice() {
        return premileagePrice;
    }

    public void setPremileagePrice(Double premileagePrice) {
        this.premileagePrice = premileagePrice;
    }

    public Double getPrerunTimePrice() {
        return prerunTimePrice;
    }

    public void setPrerunTimePrice(Double prerunTimePrice) {
        this.prerunTimePrice = prerunTimePrice;
    }

    public Integer getPretravelTime() {
        return pretravelTime;
    }

    public void setPretravelTime(Integer pretravelTime) {
        this.pretravelTime = pretravelTime;
    }

    public Double getPremileage() {
        return premileage;
    }

    public void setPremileage(Double premileage) {
        this.premileage = premileage;
    }

    public String getStartAddressDetail() {
        return startAddressDetail;
    }

    public void setStartAddressDetail(String startAddressDetail) {
        this.startAddressDetail = startAddressDetail;
    }

    public Boolean getZhuanchePrePay() {
        return zhuanchePrePay;
    }

    public void setZhuanchePrePay(Boolean zhuanchePrePay) {
        this.zhuanchePrePay = zhuanchePrePay;
    }

    public String getEndAddressDetail() {
        return endAddressDetail;
    }

    public void setEndAddressDetail(String endAddressDetail) {
        this.endAddressDetail = endAddressDetail;
    }

    public Long getAreaId() {
        return areaId;
    }

    public void setAreaId(Long areaId) {
        this.areaId = areaId;
    }

    public Area getArea() {
        return area;
    }

    public void setArea(Area area) {
        this.area = area;
    }

    public List<OrderStatus> getStatusList() {
        return statusList;
    }

    public void setStatusList(List<OrderStatus> statusList) {
        this.statusList = statusList;
    }

    public List<OrderMemo> getOrderMemos() {
        return orderMemos;
    }

    public void setOrderMemos(List<OrderMemo> orderMemos) {
        this.orderMemos = orderMemos;
    }

    public OrderReview getOrderReview() {
        return orderReview;
    }

    public void setOrderReview(OrderReview orderReview) {
        this.orderReview = orderReview;
    }


    public String getOrderMemo() {
        return orderMemo;
    }

    public void setOrderMemo(String orderMemo) {
        this.orderMemo = orderMemo;
    }

    public Long getPassengerId() {
        return passengerId;
    }

    public void setPassengerId(Long passengerId) {
        this.passengerId = passengerId;
    }

    public String getPassengerName() {
        return passengerName;
    }

    public void setPassengerName(String passengerName) {
        this.passengerName = passengerName == null ? null : passengerName.trim();
    }

    public String getPassengerPhone() {
        return passengerPhone;
    }

    public void setPassengerPhone(String passengerPhone) {
        this.passengerPhone = passengerPhone == null ? null : passengerPhone.trim();
    }

    public Long getCarId() {
        return carId;
    }

    public void setCarId(Long carId) {
        this.carId = carId;
    }

    public Long getCarTypeId() {
        return carTypeId;
    }

    public void setCarTypeId(Long carTypeId) {
        this.carTypeId = carTypeId;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber == null ? null : carNumber.trim();
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName == null ? null : carName.trim();
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }


    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getEmployName() {
        return employName;
    }

    public void setEmployName(String employName) {
        this.employName = employName == null ? null : employName.trim();
    }

    public String getEmployPhone() {
        return employPhone;
    }

    public void setEmployPhone(String employPhone) {
        this.employPhone = employPhone == null ? null : employPhone.trim();
    }


    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName == null ? null : companyName.trim();
    }

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey == null ? null : appkey.trim();
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public Boolean getIsClosed() {
        return isClosed;
    }

    public void setIsClosed(Boolean isClosed) {
        this.isClosed = isClosed;
    }

    public Boolean getReview() {
        return review;
    }

    public void setReview(Boolean review) {
        this.review = review;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public String getCancelCause() {
        return cancelCause;
    }

    public void setCancelCause(String cancelCause) {
        this.cancelCause = cancelCause == null ? null : cancelCause.trim();
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType == null ? null : payType.trim();
    }

    public Date getLasturge() {
        return lasturge;
    }

    public void setLasturge(Date lasturge) {
        this.lasturge = lasturge;
    }

    public Integer getStartWait() {
        return startWait;
    }

    public void setStartWait(Integer startWait) {
        this.startWait = startWait;
    }

    public String getStartAddress() {
        return startAddress;
    }

    public void setStartAddress(String startAddress) {
        this.startAddress = startAddress == null ? null : startAddress.trim();
    }

    public Double getStartLat() {
        return startLat;
    }

    public void setStartLat(Double startLat) {
        this.startLat = startLat;
    }

    public Double getStartLng() {
        return startLng;
    }

    public void setStartLng(Double startLng) {
        this.startLng = startLng;
    }


    public String getEndAddress() {
        return endAddress;
    }

    public void setEndAddress(String endAddress) {
        this.endAddress = endAddress == null ? null : endAddress.trim();
    }

    public Double getEndLat() {
        return endLat;
    }

    public void setEndLat(Double endLat) {
        this.endLat = endLat;
    }

    public Double getEndLng() {
        return endLng;
    }

    public void setEndLng(Double endLng) {
        this.endLng = endLng;
    }

    public Long getEmployCompanyId() {
        return employCompanyId;
    }

    public void setEmployCompanyId(Long employCompanyId) {
        this.employCompanyId = employCompanyId;
    }

    public Double getEmployProfit() {
        return employProfit;
    }

    public void setEmployProfit(Double employProfit) {
        this.employProfit = employProfit;
    }

    public Double getCompanyProfit() {
        return companyProfit;
    }

    public void setCompanyProfit(Double companyProfit) {
        this.companyProfit = companyProfit;
    }

    public Double getStartPrice() {
        return startPrice;
    }

    public void setStartPrice(Double startPrice) {
        this.startPrice = startPrice;
    }

    public Double getMileage() {
        return mileage;
    }

    public void setMileage(Double mileage) {
        this.mileage = mileage;
    }

    public Long getMidwayWait() {
        return null == midwayWait ? 0L : midwayWait;
    }

    public void setMidwayWait(Long midwayWait) {
        this.midwayWait = midwayWait;
    }

    public Long getRunTime() {
        return null == runTime ? 0L : runTime;
    }

    public void setRunTime(Long runTime) {
        this.runTime = runTime;
    }

    public Double getMileagePrice() {
        return mileagePrice;
    }

    public void setMileagePrice(Double mileagePrice) {
        this.mileagePrice = mileagePrice;
    }

    public Double getRunTimePrice() {
        return runTimePrice == null ? 0 : runTimePrice;
    }

    public void setRunTimePrice(Double runTimePrice) {
        this.runTimePrice = runTimePrice;
    }

    public Double getWaitPrice() {
        return waitPrice == null ? 0 : waitPrice;
    }

    public void setWaitPrice(Double waitPrice) {
        this.waitPrice = waitPrice;
    }

    public Double getBudgetPay() {
        return budgetPay == null ? 0 : budgetPay;
    }

    public void setBudgetPay(Double budgetPay) {
        this.budgetPay = budgetPay;
    }

    public Double getRealPay() {
        return realPay == null ? 0 : realPay;
    }

    public void setRealPay(Double realPay) {
        this.realPay = realPay;
    }

    public String getRealStartAddress() {
        if (StringUtils.isBlank(realStartAddress)) {
            return startAddress;
        }
        return realStartAddress;
    }

    public void setRealStartAddress(String realStartAddress) {
        this.realStartAddress = realStartAddress == null ? null : realStartAddress.trim();
    }

    public Double getRealStartLat() {
        if (null == realStartLat) {
            return startLat;
        }
        return realStartLat;
    }

    public void setRealStartLat(Double realStartLat) {
        this.realStartLat = realStartLat;
    }

    public Double getRealStartLng() {
        if (null == realStartLng) {
            return startLng;
        }
        return realStartLng;
    }

    public void setRealStartLng(Double realStartLng) {
        this.realStartLng = realStartLng;
    }

    public Date getServerTime() {
        return serverTime;
    }

    public void setServerTime(Date serverTime) {
        this.serverTime = serverTime;
    }

    public String getCarTypeName() {
        if (StringUtils.isNotBlank(carTypeName)) {
            return carTypeName;
        } else {
            return "该车型已删除";
        }
    }

    public void setCarTypeName(String carTypeName) {
        this.carTypeName = carTypeName;
    }

    public Double getKsMileage() {
        return ksMileage == null ? 0 : ksMileage;
    }

    public void setKsMileage(Double ksMileage) {
        this.ksMileage = ksMileage;
    }

    public Double getDdMileage() {
        return ddMileage == null ? 0 : ddMileage;
    }

    public void setDdMileage(Double ddMileage) {
        this.ddMileage = ddMileage;
    }

    public Long getCouponId() {
        return couponId;
    }

    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }

    public Double getDiscount() {
        return discount;
    }

    public void setDiscount(Double discount) {
        this.discount = discount;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public String getIfTaxi() {
        return ifTaxi;
    }

    public void setIfTaxi(String ifTaxi) {
        this.ifTaxi = ifTaxi;
    }


    public String getPreAndAfterPayType() {
        if (null != prePayTypeDetail || null != afterPayTypeDetail) {
            String str = "";
            if (null != prePayTypeDetail) {
                if (prePayTypeDetail.equals(PayTypeDetails.sign)) {
                    str = "签单";
                } else if (prePayTypeDetail.equals(PayTypeDetails.balance)) {
                    str = "余额";
                } else if (prePayTypeDetail.equals(PayTypeDetails.alipay)) {
                    str = "支付宝";
                } else if (prePayTypeDetail.equals(PayTypeDetails.weixin)) {
                    str = "微信";
                } else if (prePayTypeDetail.equals(PayTypeDetails.unionpay)) {
                    str = "银联";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_sign)) {
                    str = "优惠券+签单";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_balance)) {
                    str = "优惠券+余额";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_alipay)) {
                    str = "优惠券+支付宝";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_weixin)) {
                    str = "优惠券+微信";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon_unionpay)) {
                    str = "优惠券+银联";
                } else if (prePayTypeDetail.equals(PayTypeDetails.coupon)) {
                    str = "优惠券";
                }
            }

            if (null != afterPayTypeDetail) {
                if (afterPayTypeDetail.equals(PayTypeDetails.helppay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "代付";
                    } else {
                        if (!str.contains("代付")) {
                            str += "+代付";
                        }
                    }
                } else if (afterPayTypeDetail.equals(PayTypeDetails.sign)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "签单";
                    } else {
                        if (!str.contains("签单")) {
                            str += "+签单";
                        }
                    }
                } else if (afterPayTypeDetail.equals(PayTypeDetails.balance)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "余额";
                    } else {
                        if (!str.contains("余额")) {
                            str += "+余额";
                        }
                    }
                } else if (afterPayTypeDetail.equals(PayTypeDetails.alipay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "支付宝";
                    } else {
                        if (!str.contains("支付宝")) {
                            str += "+支付宝";
                        }
                    }
                } else if (afterPayTypeDetail.equals(PayTypeDetails.weixin)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "微信";
                    } else {
                        if (!str.contains("微信")) {
                            str += "+微信";
                        }
                    }
                } else if (afterPayTypeDetail.equals(PayTypeDetails.unionpay)) {
                    if (StringUtils.isEmpty(str)) {
                        str = "银联";
                    } else {
                        if (!str.contains("银联")) {
                            str += "+银联";
                        }
                    }
                }

            }

            if (!StringUtils.isEmpty(str)) {
                return str;
            } else {
                return null;
            }

        } else {
            return null;
        }
    }


    public String getPreAndAfterPayMoney() {

        String preAndAfterPayType = getPreAndAfterPayType();

        String str = "";
        if (null != preAndAfterPayType) {
            if (preAndAfterPayType.contains("优惠券")) {
                str += couponMoney + "+";
            }
            if (preAndAfterPayType.contains("签单") && preAndAfterPayType.contains("余额")) {
                if (preAndAfterPayType.indexOf("签单") == 0) {
                    str += signMoney + "+" + balanceMoney;
                } else if (preAndAfterPayType.indexOf("余额") == 0) {
                    str += balanceMoney + "+" + signMoney;
                }
            } else if (preAndAfterPayType.contains("签单")) {
                str += signMoney + "+";
            } else if (preAndAfterPayType.contains("余额")) {
                str += balanceMoney + "+";
            }
            if (preAndAfterPayType.contains("支付宝")) {
                str += alipayMoney + "+";
            }
            if (preAndAfterPayType.contains("银联")) {
                str += unionpayMoney + "+";
            }
            if (preAndAfterPayType.contains("微信")) {
                str += weixinMoney + "+";
            }
            if (preAndAfterPayType.contains("代付")) {
                str += cashMoney + "+";
            }
        }

        if (!StringUtils.isEmpty(str)) {
            return str.substring(0, str.length() - 1);
        } else {
            return null;
        }

    }

    public boolean getHasToPlace() {
        if (StringUtils.isBlank(endAddress) || null == endLng || null == endLat) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Order [id=" + id + ", orderNo=" + orderNo + ", passengerId=" + passengerId
            + ", passengerName="
            + passengerName + ", passengerPhone=" + passengerPhone + ", showPhone=" + showPhone
            + ", carId=" + carId
            + ", carTypeId=" + carTypeId + ", carTypeName=" + carTypeName + ", carNumber="
            + carNumber
            + ", carName=" + carName + ", channelId=" + channelId + ", channelName=" + channelName
            + ", status="
            + status + ", employId=" + employId + ", employName=" + employName + ", employPhone="
            + employPhone
            + ", companyId=" + companyId + ", companyName=" + companyName + ", appkey=" + appkey
            + ", created="
            + created + ", updated=" + updated + ", isClosed=" + isClosed + ", review=" + review
            + ", version="
            + version + ", cancelCause=" + cancelCause + ", payType=" + payType + ", lasturge="
            + lasturge
            + ", startWait=" + startWait + ", startAddress=" + startAddress + ", startLat="
            + startLat
            + ", startLng=" + startLng + ", midwayWait=" + midwayWait + ", endAddress=" + endAddress
            + ", endLat="
            + endLat + ", endLng=" + endLng + ", employCompanyId=" + employCompanyId
            + ", employProfit="
            + employProfit + ", companyProfit=" + companyProfit + ", startPrice=" + startPrice
            + ", mileage="
            + mileage + ", runTime=" + runTime + ", mileagePrice=" + mileagePrice
            + ", runTimePrice=" + runTimePrice
            + ", waitPrice=" + waitPrice + ", budgetPay=" + budgetPay + ", realPay=" + realPay
            + ", serverTime="
            + serverTime + ", orderMemo=" + orderMemo + ", zhuanchePrePay=" + zhuanchePrePay
            + ", areaId=" + areaId
            + ", area=" + area + ", orderMemos=" + orderMemos + ", orderReview=" + orderReview
            + ", statusList="
            + statusList + ", startAddressDetail=" + startAddressDetail + ", endAddressDetail="
            + endAddressDetail
            + ", preStartPrice=" + preStartPrice + ", premileagePrice=" + premileagePrice
            + ", prerunTimePrice="
            + prerunTimePrice + ", pretravelTime=" + pretravelTime + ", premileage=" + premileage
            + ", couponMoney="
            + couponMoney + ", cashMoney=" + cashMoney + ", signMoney=" + signMoney
            + ", balanceMoney="
            + balanceMoney + ", alipayMoney=" + alipayMoney + ", weixinMoney=" + weixinMoney
            + ", unionpayMoney="
            + unionpayMoney + ", guoluMoney=" + guoluMoney + ", yuanchengMoney=" + yuanchengMoney
            + ", otherMoney="
            + otherMoney + ", baoxiaoMoney=" + baoxiaoMoney + ", baoxiao=" + baoxiao
            + ", prePayTypeDetail="
            + prePayTypeDetail + ", afterPayTypeDetail=" + afterPayTypeDetail + ", couponId="
            + couponId
            + ", discount=" + discount + ", treatment=" + treatment + ", treatmentDate="
            + treatmentDate
            + ", finishTime=" + finishTime + ", employMemo=" + employMemo + ", serviceTypeId="
            + serviceTypeId
            + ", serviceType=" + serviceType + ", memo=" + memo + ", flightNo=" + flightNo
            + ", trainNo=" + trainNo
            + ", groupId=" + groupId + ", operating=" + operating + ", baoxiaoMemo=" + baoxiaoMemo
            + ", employPhoto=" + employPhoto + ", justKilometres=" + justKilometres + ", justMoney="
            + justMoney
            + ", ksMileage=" + ksMileage + ", ddMileage=" + ddMileage + ", realStartAddress="
            + realStartAddress
            + ", realStartLat=" + realStartLat + ", realStartLng=" + realStartLng + ", bookStatus="
            + bookStatus
            + ", ifTaxi=" + ifTaxi + ", createOrderName=" + createOrderName + ", makePrice="
            + makePrice
            + ", isMakePrice=" + isMakePrice + "]";
    }

    @org.springframework.web.bind.annotation.InitBinder
    public void InitBinder(WebDataBinder dataBinder) {

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        dateFormat.setLenient(false);
        dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(
            dateFormat, true));

    }

    public enum PayTypeDetails {
        /**
         * 代付
         */
        helppay,
        /**
         * 签单
         */
        sign,
        /**
         * 余额
         */
        balance,
        /**
         * 支付宝
         */
        alipay,
        /**
         * 微信
         */
        weixin,
        /**
         * 银联支付
         */
        unionpay,
        /**
         * 翼支付
         */
        bestpay,

        /**
         * 优惠劵
         */
        coupon,

        /**
         * 优惠劵+签单
         */
        coupon_sign,
        /**
         * 优惠劵+余额
         */
        coupon_balance,
        /**
         * 优惠劵+支付宝
         */
        coupon_alipay,
        /**
         * 优惠劵+微信
         */
        coupon_weixin,
        /**
         * 优惠券+银联支付
         */
        coupon_unionpay,
        /**
         * 优惠券+翼支付
         */
        coupon_bestpay,

    }

    public enum ServiceType {

        tangzu,

        rizu,

        banrizu,

        jieji,

        songji,

        jiezhan,

        songzhan
    }
}
